UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6UipQ5QO05w/UBB0/FJ8lR3wwFHNm7sjbd/dAuwe38U='
WHERE
key_id = 'b0af601a798a1d4b276941a32daf32d77226a22643bedb33468bcc2a6166951b'
AND (
token = '6UipQ5QO05w/UBB0/FJ8lR3wwFHNm7sjbd/dAuwe38U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)