UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BjgpQ+JulIWwue73kXeVlqoQV/qasO7SXmMBua9J8O8='
WHERE
key_id = 'd1a67d14f9a8569611e3690ecfa586ce3049a8a6eeebbc61e7ddbe7afb9e33c2'
AND (
token = 'BjgpQ+JulIWwue73kXeVlqoQV/qasO7SXmMBua9J8O8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)