UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '37k4nSBEoGM2VkjQUPqE2nP+3Tlx9nT6ee9AUPxDCEg='
WHERE
key_id = '401173ecefaf903215133a5c1354c82a8cafa016e9eecbc0ea6ffe10c1f5a67e'
AND (
token = '37k4nSBEoGM2VkjQUPqE2nP+3Tlx9nT6ee9AUPxDCEg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)