UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WE6lx6+WMf2ffV9zJ89+zb+D2ha4cXfMLk+vKVMclZ8='
WHERE
key_id = '051bf3041dfbe3655e6c18ccdd9b9ff1a6908665d6b70db0546e079670a7d5e5'
AND (
token = 'WE6lx6+WMf2ffV9zJ89+zb+D2ha4cXfMLk+vKVMclZ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)