UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CQBUXuLKJqFLLHjaojN/DSGwsWmkKw8EPLLAQ+KDy00=' 
WHERE 
  key_id = 'df271cba424cf055ac23cb369ea0e33634db3a624f9332f7f78281ddffb981fa' 
  AND (
    token = 'CQBUXuLKJqFLLHjaojN/DSGwsWmkKw8EPLLAQ+KDy00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034