UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6W9Il5s8lyXy3YGTRYa9eR/7V+DBjupRm6MwjjrnYSs='
WHERE
key_id = '66c9756f1ae0457712e2655d4c61f8da1c8bbbc9dd72a85e3e99208dc6e9a246'
AND (
token = '6W9Il5s8lyXy3YGTRYa9eR/7V+DBjupRm6MwjjrnYSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)