UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V1fzuQHTAz4LRVmlXsoB+v5iZQNCibRE/iPQ2EIxvZc=' 
WHERE 
  key_id = 'abcf2d063583cf093e90f43f478fcbebfe599c6cacaffefb118197bb1a8e4649' 
  AND (
    token = 'V1fzuQHTAz4LRVmlXsoB+v5iZQNCibRE/iPQ2EIxvZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032