UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yrWscPMcRBqmOKhUcTHZ6m/T+oAtF6V1MwJGP04nXDI=' 
WHERE 
  key_id = 'bfcef5270398f6e2289f68fffa05570aa0d9e99dc3124ecc337eedffcf58b5b2' 
  AND (
    token = 'yrWscPMcRBqmOKhUcTHZ6m/T+oAtF6V1MwJGP04nXDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021