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