UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6RhcELcfkmITbqfqaH3avxWW253ZxGC4kO+If6xiBhc='
WHERE
key_id = '3083587ba56a17036d8a171d520d61124e0304b90869150bb9d06be8b48b4824'
AND (
token = '6RhcELcfkmITbqfqaH3avxWW253ZxGC4kO+If6xiBhc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)