UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1yar1zWyQtKvgdiTyO+piH6rTk5akIHhSXsDdoIG0VE='
WHERE
key_id = '6a214f9d1743c487ed5dd2b495a5930d7c8a8a76327726a59b082cd585187aea'
AND (
token = '1yar1zWyQtKvgdiTyO+piH6rTk5akIHhSXsDdoIG0VE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)