UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pMOFVELCllr+mWNA+Yn99btE3rHZ7PBVBoiAGVnvBDo='
WHERE
key_id = '079ad34e706eb1518cf10ec1b12158878064af1a92f373cfa5dd76cff4ff44ce'
AND (
token = 'pMOFVELCllr+mWNA+Yn99btE3rHZ7PBVBoiAGVnvBDo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)