UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/JPP9+ZyBuv25zvDwHb9tTa9ufhbiulpZvr5qqLyAWQ=' 
WHERE 
  key_id = '231f0461e7355f35a623adec4fffdae379c4b1531eb7a499ff9adea164dc88ef' 
  AND (
    token = '/JPP9+ZyBuv25zvDwHb9tTa9ufhbiulpZvr5qqLyAWQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044