UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bU9F2qdnOrF0feas43rUIBSPEhEsSaavgdiQ7RxQ6yA=' 
WHERE 
  key_id = '306db790618b843cdf3e1ca5a7de0bb9d068094dbadb148f59ecc052bd7d86ed' 
  AND (
    token = 'bU9F2qdnOrF0feas43rUIBSPEhEsSaavgdiQ7RxQ6yA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033