UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jIC1aeLkY2RPQN5gBaw4tNpwepmsPt8/IFNtuKDYeL0='
WHERE
key_id = '4dda02f3aed8079985cf3b2cefaf69c460a8dbb4c42cbcbf223a2c599c413307'
AND (
token = 'jIC1aeLkY2RPQN5gBaw4tNpwepmsPt8/IFNtuKDYeL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)