UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FEYtAFMzQ8fsR9P8fxrwxT7iJuK0g/psMcc0UrPivUI='
WHERE
key_id = 'cd50de74fa3391dbc7653bb6ad2bb84f9c0669a5922c04892722567ea859f22c'
AND (
token = 'FEYtAFMzQ8fsR9P8fxrwxT7iJuK0g/psMcc0UrPivUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)