UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TfSwZACDn3zZF7aoT6idXW4QzDmxGCaFC8KgItjDWwg=' 
WHERE 
  key_id = 'fa0157146df617b92df56eac0c6d5aaf09a7a49fc07c6eae4d87300421800f0c' 
  AND (
    token = 'TfSwZACDn3zZF7aoT6idXW4QzDmxGCaFC8KgItjDWwg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025