UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oejbo958hyQCR3AD1z4NUqqD4Qbwr13FndZtbpEoGvk='
WHERE
key_id = '3de00f5acc4c4bfe0fbd1a0fe996df6131510a120175ff701eae0e4b11e1452d'
AND (
token = 'Oejbo958hyQCR3AD1z4NUqqD4Qbwr13FndZtbpEoGvk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)