UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zNuPc/8sz5JXp2hXvl/Gd0f7C0aQJ5HPGsGZokv7tLw=' 
WHERE 
  key_id = '6b6399606fe248a20706df66a7aa59a56cdfa05a524d65170e14f7fa8294f148' 
  AND (
    token = 'zNuPc/8sz5JXp2hXvl/Gd0f7C0aQJ5HPGsGZokv7tLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020