UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lskS/ixrQppnWB7t3GlC7reOVl1qUzi5Lm0waeKt+Mw=' 
WHERE 
  key_id = '08c3f63405d8c255be5ce3f1f0e1ccf5d16364bc5fbaab4fdd87efeb87cf3978' 
  AND (
    token = 'lskS/ixrQppnWB7t3GlC7reOVl1qUzi5Lm0waeKt+Mw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033