UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hl9/9KC+atNWYQwPR9zQmlW601+XQfdBXMnRr8f5aVE='
WHERE
key_id = '7d6f90b37accd973da73778a999f91028c2f74be7ccf1a4a9e4446e4631d79f4'
AND (
token = 'hl9/9KC+atNWYQwPR9zQmlW601+XQfdBXMnRr8f5aVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)