UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ub0glGfmUP0ZbVDnG9sBmLZjw//jrqnFDhCs6cowv1o='
WHERE
key_id = 'ef7eea2166f72dcf9b452cd2a318992c6f88ba178f3dc3ba99f4dee419e73d57'
AND (
token = 'Ub0glGfmUP0ZbVDnG9sBmLZjw//jrqnFDhCs6cowv1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)