UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3HKRPpAi4XAwR8ClMnW3At/r061TOpo5qXXIF/0uo5E='
WHERE
key_id = 'e8c8bd591502e14bbd564f3d61417713b084c18c25e01dbbf81b73e613e22455'
AND (
token = '3HKRPpAi4XAwR8ClMnW3At/r061TOpo5qXXIF/0uo5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)