UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qf6ZrIL+HQ1OuuD982PdmVAOudMlbs+RoGF/cLjqVyQ=' 
WHERE 
  key_id = 'b580132512b07934f33198d8b607e9a32391b040a8ad1710fb4e0006bad7e057' 
  AND (
    token = 'qf6ZrIL+HQ1OuuD982PdmVAOudMlbs+RoGF/cLjqVyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017