UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GxwSe/1FFOF+bGChmFQHAb6Kx6hmwJRwxp+O6OeROqo=' 
WHERE 
  key_id = 'e3976219bdd9c1088df65065419daf40e118f20d5f45df649d0fd844db41d92d' 
  AND (
    token = 'GxwSe/1FFOF+bGChmFQHAb6Kx6hmwJRwxp+O6OeROqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027