UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HV+NTnQjscliFkOLo/kPANMnHwaDaF1ZhqnzaQ24yI0='
WHERE
key_id = 'fd3e61a4594880ed57bcf4661637d0e5926a8fbbbba608f643507d782a01b206'
AND (
token = 'HV+NTnQjscliFkOLo/kPANMnHwaDaF1ZhqnzaQ24yI0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)