UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'el/rh9P6Itm98R4KWGr5ANq9FCmOu804Kofd76FA1eQ='
WHERE
key_id = 'cc126efb012a38d1b99fd6434d979856eea91fff4ff380ef8a532ae7d71e63fb'
AND (
token = 'el/rh9P6Itm98R4KWGr5ANq9FCmOu804Kofd76FA1eQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)