UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nAgaut36K/hsoqKUCRKPZo13MziZEMNVk/9NVpJi3+M='
WHERE
key_id = '7a62320859465ba62e068e9fa4e8d9892e7abd8a9313c052ed88c5f0d08bbc21'
AND (
token = 'nAgaut36K/hsoqKUCRKPZo13MziZEMNVk/9NVpJi3+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)