UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vyPmcdV57uetWWvgGZM5jsSgA/ozkQ7v1V1AvYdeydU='
WHERE
key_id = 'c2a1e919da2aa39660b9b2fd188e0cb84cc498e27088d56ecf7b39a62d51fc0b'
AND (
token = 'vyPmcdV57uetWWvgGZM5jsSgA/ozkQ7v1V1AvYdeydU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)