UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hcCrtN/dztsA0wbjQSG3XrTNBoBN6opv5Ipl4Mx7boE='
WHERE
key_id = '06d37c42ccbe41a2d17edaf6648ec50b0d7012970066174591a255ac4fc17eb2'
AND (
token = 'hcCrtN/dztsA0wbjQSG3XrTNBoBN6opv5Ipl4Mx7boE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)