UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hyclVXN1OUgy2gz1XL+zhonzGTxT+fKh3CiUh2zsZDg=' 
WHERE 
  key_id = '9156e6a83b25e29706e117a97d6d7fd6f6cadb28bbb9f3469d2d61eda53d1037' 
  AND (
    token = 'hyclVXN1OUgy2gz1XL+zhonzGTxT+fKh3CiUh2zsZDg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019