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

Query time 0.00040