UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JMeu+I5ImXj674XQo7FoOveKMBX3ORps346fi3O9xcg='
WHERE
key_id = '6aa4ea04eefb331e486c862325c30671d4ae7cdfa391bb1571ee32f2ec17c2b7'
AND (
token = 'JMeu+I5ImXj674XQo7FoOveKMBX3ORps346fi3O9xcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)