UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1rLOsg+7UaYafmPEL0P5KSHEOqINuijrUBE6fEkHWWM='
WHERE
key_id = 'e508fc117b2327c5d4a52e1e7b41a2359dc6975cacf72c596ce444ca9672d0fa'
AND (
token = '1rLOsg+7UaYafmPEL0P5KSHEOqINuijrUBE6fEkHWWM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)