UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qLLf3Oa3jBeZOMEJL8lcJ6J6P13yfyTr45mcueEIYII='
WHERE
key_id = 'ac9f293fe6325c177accf423721e80b81936d4b6bea67d395ca07aeda4c78c54'
AND (
token = 'qLLf3Oa3jBeZOMEJL8lcJ6J6P13yfyTr45mcueEIYII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)