UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gmDELDdQQDC5BAeJBejumXmb++0c2r+t+A5mKicElbk=' 
WHERE 
  key_id = '76bc59e1d42531a392b56efa7f7eb59b5910368cb9c8fdadfcce4a31c060b908' 
  AND (
    token = 'gmDELDdQQDC5BAeJBejumXmb++0c2r+t+A5mKicElbk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031