UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b8DvUIhEMeyNksbnWHJ49FYbd+WOyYyW3251SOepG5o='
WHERE
key_id = 'b5efe69027876c683c06305f015f2586d108abfb525f31d8907b3787627e2baf'
AND (
token = 'b8DvUIhEMeyNksbnWHJ49FYbd+WOyYyW3251SOepG5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)